package com.stockz.equity.charting.event.listener;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.stockz.equity.charting.view.StockChartView;
import com.stockz.equity.charting.view.StockChart;

@Component
public class SelectionListener extends MouseAdapter {

	@Autowired private StockChartView chartingView;
	
	@Override
	public void mouseClicked(MouseEvent e) {
		chartingView.setSelectedStockChart((StockChart)e.getSource());
	}
	@Override
	public void mouseEntered(MouseEvent e) {
		chartingView.setSelectedStockChart((StockChart)e.getSource());
	}
	@Override
	public void mousePressed(MouseEvent e) {
		chartingView.setSelectedStockChart((StockChart)e.getSource());
	}
}
